#define _CRT_SECURE_NO_WARNINGS 1

#include "Stack.h"
#include "Queue.h"

void Stacktest()
{
	Stack st;

	StackInit(&st);

	StackPush(&st, 10);
	StackPush(&st, 9);
	StackPush(&st, 8);
	StackPush(&st, 7);

	printf("%d\n", StackSize(&st));
	while (!StackEmpty(&st))
	{
		int top = StackTop(&st);
		printf("%d ", top);
		StackPop(&st);
	}

	
	StackDestory(&st);
}

void QueueTest()
{
	Queue q;
	QueueInit(&q);

	QueuePush(&q, 10);
	QueuePush(&q, 9);
	QueuePush(&q, 8);
	QueuePush(&q, 7);
	QueuePush(&q, 5);

	printf("%d ", QueueSize(&q));
	QueuePop(&q);
	printf("%d ", QueueFront(&q));
	printf("%d\n", QueueRear(&q));

	QNode* phead = q._front;
	while (phead)
	{
		printf("%d ", phead->_data);
		phead = phead->_next;
	}

	QueueDestory(&q);

}
int main()
{
	//Stacktest();
	QueueTest();
	return 0;
}